import { request } from '@/plugins/request'

// 获取公共文章列表
export const getArticle = params => {
  return request({
    method: "GET",
    url: "/api/articles",
    params,
  });
}

// 获取个人文章列表
export const getYourFeedArticle = params => {
  return request({
    method: "GET",
    url: "/api/articles/feed",
    params,
  });
}

// 添加点赞
export const addFavorite = slug => {
  return request({
    method: "POST",
    url: `/api/articles/${slug}/comments`,
    params,
  });
}

// 取消点赞
export const deleteFavorite = slug => {
  return request({
    method: "DELETE",
    url: `/api/articles/${slug}/comments`,
    params,
  });
}

